﻿@using PerpetuumSoft.Knockout
@using TimeProject.WebSite.Views;

@model TimeProject.WebSite.ViewModels.RegisterViewModel
@{
    var ko = Html.CreateKnockoutContext();
}

@using (ko.With(m => m.Messages))
{
    @Html.GetInfoBox(Model.Messages)
}

<div class="page-header">
    <h1>REGISTER <small>Create a new account.</small></h1>
</div>

<form class="form-horizontal">
    <div class="well">
        <div class="row-fluid">
            <div class="span6">
                <div class="span6">
                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.Username)
                        </div>
                        <div class="controls">
                            @ko.Html.GetTextBox(x => x.Username)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.Password)
                        </div>
                        <div class="controls">
                            @ko.Html.GetPasswordTextBox(x => x.Password)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.ConfirmPassword)
                        </div>
                        <div class="controls">
                            @ko.Html.GetPasswordTextBox(x => x.ConfirmPassword)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.FullName)
                        </div>
                        <div class="controls">
                            @ko.Html.GetTextBox(x => x.FullName)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.EMail)
                        </div>
                        <div class="controls">
                            @ko.Html.GetTextBox(x => x.EMail)
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            @Html.GetLabel(x => x.ConfirmEMail)
                        </div>
                        <div class="controls">
                            @ko.Html.GetTextBox(x => x.ConfirmEMail)
                        </div>
                    </div>
                </div>
            </div>

            <div class="span6">
                @Html.GetInfoText("You must accept the licence agreement to register.")
                <div id="LicenceAgreement">
                    @Html.GetLicence()
                </div>

                <p class="paragraph-break" />
                <div class="control-group">
                    <div class="control-label">
                        @Html.GetLabel(x => x.AcceptLicence)
                    </div>
                    <div class="controls">
                        @ko.Html.GetCheckBox(x => x.AcceptLicence)
                    </div>
                </div>
            </div>
        </div>
    </div>

    @Html.GetFixedBackLink("Login")
    @ko.Html.GetButtonRight("Register", "Register")
    @ko.Init(Model)
</form>